/**
 * 
 */
package com.viettel.core.entities.cms;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import com.viettel.core.enumtype.ExpertTechniqueStatus;


/**
 *  TABLE EXPERT_TECHNIQUE
 *  @author: HUYNHDC
 *  @version: 1.0
 *  @since: 24-06-2014
 */
@Entity
@Table(name = "EXPERT_TECHNIQUE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "EXPERT_TECHNIQUE_SEQ", allocationSize = 1)
public class ExpertTechnique implements Serializable {


	private static final long serialVersionUID = -8695245664817844200L;


	/** The id. */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
    @Column(name = "ID")
    private Integer id;
    
   
    @ManyToOne(targetEntity = CmsUser.class)
    @JoinColumn(name = "CMS_USERS_ID", referencedColumnName = "id")
    @ForeignKey(name = "EXPERT_TECHNIQUE_CMS_USER_FK")
    private CmsUser cmsUsers;

    @ManyToOne(targetEntity = TechniqueCategory.class)
    @JoinColumn(name = "TECHNIQUE_CATEGORY_ID", referencedColumnName = "id")
    @ForeignKey(name = "EXPERT_TECHNIQUE_TECHNIQUE_FK")
    private TechniqueCategory techniqueCategory;

    @Basic
	@Column(name = "STATUS", columnDefinition = "NUMBER(1,0)", nullable = false)
	@Type(type = "com.viettel.core.enumtype.GenericEnumUserType", parameters = {
			@Parameter(name = "enumClass", value = "com.viettel.core.enumtype.ExpertTechniqueStatus"),
			@Parameter(name = "identifierMethod", value = "getValue"),
			@Parameter(name = "valueOfMethod", value = "parseValue") })
	@Index(name="EXPERT_TECHNIQUE_STATUSX")
	private ExpertTechniqueStatus status;
    
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public CmsUser getCmsUsers() {
		return cmsUsers;
	}

	public void setCmsUsers(CmsUser cmsUsers) {
		this.cmsUsers = cmsUsers;
	}

	public TechniqueCategory getTechniqueCategory() {
		return techniqueCategory;
	}

	public void setTechniqueCategory(TechniqueCategory techniqueCategory) {
		this.techniqueCategory = techniqueCategory;
	}

	public ExpertTechniqueStatus getStatus() {
		return status;
	}

	public void setStatus(ExpertTechniqueStatus status) {
		this.status = status;
	}

}
